import instance from '../utils/request'

// 密码登录
export const passwordLogin = data => {
    const {
        email,
        password,
        role
    } = data
    return instance({
        url: '/passwordLogin',
        method: 'POST',
        data: {
            email,
            password,
            role
        },
        headers: {
            'Content-Type': 'application/json'
          },
    })
}

// 密码登录
export const codeLogin = data => {
    const {
        email,
        captcha,
        role
    } = data
    return instance({
        url: '/captchaLogin',
        method: 'POST',
        data: {
            email,
            captcha,
            role
        },
        headers: {
            'Content-Type': 'application/json'
          },
    })
}